import BTTree from "../../Base/BTTree"
import ActionAttack from "../Action/ActionAttack"
import ActionLog from "../Action/ActionLog"
import ActionSkill from "../Action/ActionSkill"
import ActionSleep from "../Action/ActionSleep"
import ActionWait from "../Action/ActionWait"
import ActionWork from "../Action/ActionWork"
import CompositeRandomSequence from "../Composite/CompositeRandomSequence"
import CompositeSelector from "../Composite/CompositeSelector"
import CompositeSequence from "../Composite/CompositeSequence"
import ConditionHP from "../Conditional/ConditionalHP"
import ConditionMP from "../Conditional/ConditionalMP"

export default class Tree1 extends BTTree {
  constructor() {
    super()
    this.init()
  }
  init() {
    // this.root = new ActionLog('Tree1 Hello World')
    // this.root = new CompositeSequence(
    //   [
    //     new ActionLog('log1'),
    //     new ActionLog('log2')
    //   ]
    // )
    this.root = new CompositeSequence([
      new CompositeSelector([
        new CompositeSequence([
          new ConditionMP(),
          new CompositeSequence([
            new ActionWait(),
            new ActionSkill()
          ])
        ]),
        new CompositeSequence([
          new ConditionHP(),
          new ActionAttack()
        ]),
        new CompositeRandomSequence([
          new ActionWork(),
          new ActionSleep()
        ])
      ])
    ])
  }
}